package com.tledu.springboot19.service.impl;

import com.tledu.springboot19.dao.StudentDao;
import com.tledu.springboot19.entity.Student;
import com.tledu.springboot19.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 代表这是一个service层代码
 */
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentDao studentDao;

    @Override
    public List<Student> list(String name) {
        // 由于业务比较简单，所以代码比较少，正常情况下，这里应该编码最多的地方
        return studentDao.list(name);
    }

    @Override
    public void insert(Student student) {
        studentDao.insert(student);
    }
}
